.class public Lcom/kuguo/ui/ImageGallery;
.super Landroid/widget/Gallery;


# instance fields
.field private a:Landroid/graphics/Bitmap;

.field private b:Landroid/graphics/Bitmap;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/kuguo/ui/ImageGallery;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Landroid/widget/Gallery;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    new-instance v0, Lcom/kuguo/ui/b;

    invoke-direct {v0, p0}, Lcom/kuguo/ui/b;-><init>(Lcom/kuguo/ui/ImageGallery;)V

    invoke-virtual {p0, v0}, Lcom/kuguo/ui/ImageGallery;->setAdapter(Landroid/widget/SpinnerAdapter;)V

    return-void
.end method

.method private a(Landroid/graphics/Canvas;)V
    .locals 12

    const/4 v10, 0x0

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getAdapter()Landroid/widget/SpinnerAdapter;

    move-result-object v0

    invoke-interface {v0}, Landroid/widget/SpinnerAdapter;->getCount()I

    move-result v0

    if-lez v0, :cond_1

    iget-object v1, p0, Lcom/kuguo/ui/ImageGallery;->a:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/kuguo/ui/ImageGallery;->b:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/kuguo/ui/ImageGallery;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v1

    iget-object v2, p0, Lcom/kuguo/ui/ImageGallery;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v2

    const/16 v3, 0xa

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getSelectedItemPosition()I

    move-result v4

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getWidth()I

    move-result v5

    mul-int v6, v1, v0

    sub-int/2addr v5, v6

    const/4 v6, 0x1

    sub-int v6, v0, v6

    mul-int/2addr v6, v3

    sub-int/2addr v5, v6

    div-int/lit8 v5, v5, 0x2

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getHeight()I

    move-result v6

    sub-int v2, v6, v2

    sub-int/2addr v2, v3

    const/4 v6, 0x0

    move v11, v6

    move v6, v5

    move v5, v11

    :goto_0
    if-ge v5, v0, :cond_1

    if-eq v5, v4, :cond_0

    iget-object v7, p0, Lcom/kuguo/ui/ImageGallery;->a:Landroid/graphics/Bitmap;

    int-to-float v8, v6

    int-to-float v9, v2

    invoke-virtual {p1, v7, v8, v9, v10}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    :goto_1
    add-int v7, v1, v3

    add-int/2addr v6, v7

    add-int/lit8 v5, v5, 0x1

    goto :goto_0

    :cond_0
    iget-object v7, p0, Lcom/kuguo/ui/ImageGallery;->b:Landroid/graphics/Bitmap;

    int-to-float v8, v6

    int-to-float v9, v2

    invoke-virtual {p1, v7, v8, v9, v10}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    goto :goto_1

    :cond_1
    return-void
.end method


# virtual methods
.method public a(Landroid/graphics/Bitmap;I)V
    .locals 1

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getAdapter()Landroid/widget/SpinnerAdapter;

    move-result-object p0

    check-cast p0, Lcom/kuguo/ui/b;

    invoke-virtual {p0}, Lcom/kuguo/ui/b;->a()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p2, p1}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {p0}, Lcom/kuguo/ui/b;->notifyDataSetChanged()V

    return-void
.end method

.method public a(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
    .locals 0

    iput-object p1, p0, Lcom/kuguo/ui/ImageGallery;->a:Landroid/graphics/Bitmap;

    iput-object p2, p0, Lcom/kuguo/ui/ImageGallery;->b:Landroid/graphics/Bitmap;

    return-void
.end method

.method public a(Ljava/util/List;)V
    .locals 0

    invoke-virtual {p0}, Lcom/kuguo/ui/ImageGallery;->getAdapter()Landroid/widget/SpinnerAdapter;

    move-result-object p0

    check-cast p0, Lcom/kuguo/ui/b;

    invoke-virtual {p0, p1}, Lcom/kuguo/ui/b;->a(Ljava/util/List;)V

    return-void
.end method

.method public draw(Landroid/graphics/Canvas;)V
    .locals 0

    invoke-super {p0, p1}, Landroid/widget/Gallery;->draw(Landroid/graphics/Canvas;)V

    invoke-direct {p0, p1}, Lcom/kuguo/ui/ImageGallery;->a(Landroid/graphics/Canvas;)V

    return-void
.end method
